package com.warm.orm.domain.sys;

import com.easy.query.core.annotation.Column;
import com.easy.query.core.annotation.EntityProxy;
import com.easy.query.core.annotation.Table;
import com.easy.query.core.proxy.ProxyEntityAvailable;
import com.warm.orm.domain.BaseEntity;
import com.warm.orm.domain.sys.proxy.SysNoticeProxy;
import com.warm.xss.anaotation.Xss;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.noear.solon.validation.annotation.Length;
import org.noear.solon.validation.annotation.NotBlank;

import java.io.Serial;


/**
 * 通知公告表 sys_notice
 *
 * @author warm
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Table("sys_notice")
@EntityProxy
public class SysNotice extends BaseEntity implements ProxyEntityAvailable<SysNotice, SysNoticeProxy> {
    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 公告ID
     */
    @Column(primaryKey = true, increment = true)
    private Long noticeId;

    private String tenantId;

    /**
     * 公告标题
     */
    @Xss(message = "公告标题不能包含脚本字符")
    @NotBlank(message = "公告标题不能为空")
    @Length(max = 50, message = "公告标题不能超过50个字符")
    private String noticeTitle;

    /**
     * 公告类型（1通知 2公告）
     */
    private String noticeType;

    /**
     * 公告内容
     */
    private String noticeContent;

    /**
     * 公告状态（0正常 1关闭）
     */
    private String status;

    /**
     * 备注
     */
    private String remark;

    @Override
    public Class<SysNoticeProxy> proxyTableClass() {
        return SysNoticeProxy.class;
    }
}
